/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Testing;

import POJO.StatusPOJO;
import POJO.TagNameAndCounter;
import ServicesAccessData.User;
import java.util.List;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;

/**
 *
 * @author huy
 */
public class NonblockingClientUser {

    private void invoke() {
        TTransport transport;
        try {
            transport = new TFramedTransport(new TSocket("localhost", 7911));
            TProtocol protocol = new TBinaryProtocol(transport);

            User.Client client = new User.Client(protocol);
            transport.open();

//            /*Gọi các phương thức trong service tại đây*/
            
//            List<TagNameAndCounter> listTagName = client.selectAllTagNameAndCounter();
//            System.out.println(listTagName);
            
//            List<StatusPOJO> listStatus = client.selectTopStatus(5);
//            System.out.println(listStatus);
            
            transport.close();
        } catch (TTransportException e) {
        } catch (TException e) {
        }
    }
    public static void main(String[] args) {
        NonblockingClientUser c = new NonblockingClientUser();
        c.invoke();
    }
}